﻿@model Gagnatek.WebSite.Models.Medias
@{
    ViewBag.Title = "Details";
}
<h2>
    Details</h2>
<fieldset>
    <legend>@Html.DisplayFor(model => model.name)</legend>
    <br />
    <div class="display-field">
        @Html.DisplayFor(model => model.description)
    </div>
    <table width="100%">
        <tr>
            <td>
                <h4>
                    Auteur</h4>
                @Html.DisplayFor(model => model.Authors.name)
            </td>
            <td>
                <h4>
                    Type</h4>
                @Html.DisplayFor(model => model.MediaTypes.name)
            </td>
        </tr>
    </table>
</fieldset>
<p>
    @if (User.IsInRole("Owner"))
    {
        @Html.ActionLink("Edit", "Edit", new { id = Model.id })   
        <br />                                                   
        @Html.ActionLink("Retour", "Index")
    }
    else if (User.IsInRole("Customer"))
    {
        @Html.ActionLink("Réserver", "Create", "Loans", new { mediaId = Model.id, userName = User.Identity.Name }, null)
        <br />
        @Html.ActionLink("Retour", "Index", "Home") 
    }
</p>
